@import '~@/assets/css/mixins';

.flow_container {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;

  .flow_id {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .flow_panel_header {
    position: absolute;
    width: 100%;
    height: 48px;
    background-color: #fff;
    border-bottom: 1px solid rgb(0 0 0 / 10%);
    user-select: none;

    .flow_panel_button {
      float: right;
      margin-top: 7px;
      margin-right: 10px;
    }

    dl,
    dt,
    dd {
      float: left;
      color: rgb(0 0 0 / 65%);
      font-size: 14px;
      cursor: pointer;
    }

    dl {
      margin-top: 4px;
      margin-left: 7px;
      padding: 8px 9px;
      dd {
        margin-left: 3px;
      }
    }

    .active_icon {
      background-color: rgb(0 132 255 / 5%);
      dd,
      dt {
        color: #0084ff;
      }
    }
  }

  .flow_panel {
    position: absolute;
    top: 62px;
    left: 14px;
    width: 172px;
    height: calc(100% - 30%);
    background: #fff;
    border: 1px solid rgb(0 0 0 / 5.1%);
    border-radius: 2px;
    box-shadow: 0 8px 16px rgb(3 17 29 / 12%);
    user-select: none;

    .title {
      width: 100%;
      height: 44px;
      color: rgb(0 0 0 / 65%);
      font-weight: bold;
      font-size: 14px;
      line-height: 44px;
      text-indent: 16px;
      background: #f8f9fb;
      border-radius: 2px 2px 0 0;
    }

    .center {
      width: 100%;
      height: calc(100% - 44px);
      overflow-y: auto;
    }

    .panel {
      width: 100%;
      height: 40px;
      margin-bottom: 10px;
      font-size: 14px;
      line-height: 40px;
      border: 1px solid rgb(0 0 0 / 10.2%);
      border-radius: 2px;
      cursor: pointer;
    }

    .panel:last-child {
      margin-bottom: 0;
    }
  }

  .flow_right {
    position: absolute;
    top: 48px;
    right: 0;
    width: 50px;
    height: 100%;
    background-color: #fff;
    border-left: 1px solid rgb(0 0 0 / 10%);
    span {
      display: block;
      width: 16px;
      height: 90px;
      margin-left: 17px;
      color: @gray-600;
      cursor: pointer;
      &:first-child {
        margin-top: 16px;
      }
      &.on {
        position: relative;
        color: @primary;
        &::before {
          content: "";
          position: absolute;
          right: -16px;
          top: 0;
          width: 3px;
          height: 100%;
          background: @primary;
          border-radius: 2px 0 0 2px;
        }
      }
    }
    span + span {
      margin-top: 40px;
    }
  }
}

.node .status {
  flex-shrink: 0;
}

.node {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding-right: 8Px;
  background-color: #fff;
  border: 1Px solid #c2c8d5;
  border-top: 4Px solid #5f95ff;
  border-radius: 4Px;
  box-shadow: 0 2Px 5Px 1Px rgb(0 0 0 / 6%);
  svg {
    width: 20Px;
    height: 20Px;
  }
  .label {
    display: inline-block;
    width: 144Px;
    height: 30Px;
    margin-left: 8Px;
    color: #666;
    font-size: 12Px;
    line-height: 30Px;
  }
}
.node_z {
  border-top: 4Px solid #8d5ded;
}
.node_green {
  border-top: 4Px solid #13c2c2;
}
.node_red {
  border-top: 4Px solid #ef5350;
}
.node_blue {
  border-top: 4Px solid #1890ff;
}
.running {
  // animation: spin 1s linear infinite;
}

@keyframes running_line {
  to {
    stroke-dashoffset: -1000;
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

:global {
  .x6-node-selected {
    .node_z {
      border-color: #8d5ded;
      border-radius: 2px;
      box-shadow: 0 0 0 4px rgb(141 93 237 / 10%);
    }
    .node_green {
      border-color: #13c2c2;
      border-radius: 2px;
      box-shadow: 0 0 0 4px rgb(19 194 194 / 10%);
    }
    .node_red {
      border-color: #ef5350;
      border-radius: 2px;
      box-shadow: 0 0 0 4px rgb(239 83 80 / 10%);
    }
    .node_blue {
      border-color: #1890ff;
      border-radius: 2px;
      box-shadow: 0 0 0 4px rgb(0 132 255 / 10%);
    }
  }
  .x6-edge:hover {
    path:nth-child(2) {
      stroke: #1890ff;
      stroke-width: 1px;
    }
  }

  .x6-edge-selected {
    path:nth-child(2) {
      stroke: #1890ff;
      stroke-width: 1.5px !important;
    }
  }
}

.flow_log {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.offline_icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: 12px;
  line-height: 24px;
  text-align: center;
  border-radius: 2px;
}

.offline_icon_green {
  color: #13c2c2;
  background-color: rgb(19 194 194 / 10%);
}
.offline_icon_red {
  color: #ef5350;
  background-color: rgb(239 83 80 / 10%);
}
.offline_icon_blue {
  color: #0084ff;
  background-color: rgb(0 132 255 / 10%);
}
.offline_icon_z {
  color: #8d5ded;
  background-color: rgb(141 93 237 / 10%);
}

.disable {
  color: rgb(0 0 0 / 35%) !important;
  cursor: not-allowed !important;

  dl,
  dt,
  dd {
    color: rgb(0 0 0 / 35%) !important;
    cursor: not-allowed !important;
  }
}
